<?php
	require_once("../utils/db.php");
	session_start();
	$conn=connect();
	$sql="select * from fishvideo_users where yjl_uname='{$_POST['user']}'
	and yjl_password=md5('{$_POST['pwd']}');";
	//echo $sql;
	$result=mysql_query($sql,$conn);
	$num=mysql_num_rows($result);
	//echo $num;
	$url="../index.php";
	if($num<1){
		echo "<script>alert('登陆失败！');</script>";
		
	}else{
		$row=mysql_fetch_array($result);
		$_SESSION['username']=$row['yjl_uname'];
		$_SESSION['userid']=$row['yjl_uid'];
		echo "<script>alert('登陆成功！');</script>";
	}
	mysql_close($conn);//关闭数据库
	echo "<meta http-equiv='Refresh' content='0;URL={$url}'>"; //跳转界面
?>